package com.hns.can.mainte.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hns.can.common.aop.orgTree.LeftOrgAnnotation;
import com.hns.can.common.constants.GlobalConst;
import com.hns.can.common.formula.FillCodeDscValue;
import com.hns.can.common.formula.FillParamsVo;
import com.hns.can.common.service.BaseInfoValueService;
import com.hns.can.common.vo.CommonParamsVo;
import com.hns.can.mainte.vo.VMSStatusVo;
import com.hns.frame.mybatis.Pagination;
import com.hns.frame.service.CommonService;
import com.hns.tool.pub.PubUtil;

/**
 * 整车控制Service
 * @author:zhangzq
 * @email:
 * @version Revision 2.0.0
 */
@Service
public class VMSStatusService extends CommonService{
	
    @Autowired
    private BaseInfoValueService baseInfoValueService;
	
    /**
     * 分页查询整车控制数据
     * @param params
     * @return
     * @throws Exception
     * @author:zhangzq
     * @email:
     */
	@LeftOrgAnnotation()
    @Transactional
	public Pagination searchVMSStatus(CommonParamsVo params) throws Exception {
		Pagination page = this.myBatisPage("vmsStatus.searchVMSStatusCount", "vmsStatus.searchVMSStatusData", params, VMSStatusVo.class);
		List list = page.getData();
		baseInfoValueService.fillOrganLineLicPltNo(list);
        page.setData(list);
        return page;
	}
	
	/**
	 * 获取整车控制数据
	 * @param params
	 * @return
	 * @throws Exception
	 * @author:zhangzq
	 * @email:
	 */
	@SuppressWarnings("unchecked")
    @LeftOrgAnnotation()
    @Transactional
    public List<VMSStatusVo> getVMSStatusData(CommonParamsVo params) throws Exception {
        List<VMSStatusVo> list = PubUtil.convertListMapToObject(sqlMapDao.selectList("vmsStatus.searchVMSStatusData", params), VMSStatusVo.class);
        baseInfoValueService.fillOrganLineLicPltNo(list);
        return list;
    }
}
